home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / Emulation_Include_Files / ras.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  12.2 KB  |  474 lines

  1. /*++
  2.  
  3. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  4. ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  5. THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  6. PARTICULAR PURPOSE.
  7. Copyright (c) 1995-1998  Microsoft Corporation
  8.  
  9. Module Name:
  10.  
  11. ras.h
  12.  
  13. Abstract:
  14.  
  15. Remote Access Service structures and defines
  16.  
  17. Notes: 
  18.  
  19. --*/
  20.  
  21. // @CESYSGEN IF CE_MODULES_PPP
  22. #ifndef _RAS_H_
  23. #define _RAS_H_
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28.  
  29. #ifndef UNLEN
  30. #include <lmcons.h>
  31. #endif
  32. #include <tapi.h>
  33.  
  34. #include "pshpack4.h"
  35.  
  36. #define RAS_MaxEntryName      20
  37. #define RAS_MaxDeviceName     32
  38. #define RAS_MaxDeviceType     16
  39. #define RAS_MaxParamKey       32
  40. #define RAS_MaxParamValue     128
  41. #define RAS_MaxPhoneNumber    128
  42. #define RAS_MaxCallbackNumber 48
  43. #define RAS_MaxIpAddress      15
  44. #define RAS_MaxIpxAddress     21
  45.  
  46. // Ras extensions
  47.  
  48. #define    RAS_MaxAreaCode            (10)            // TBD
  49. #define    RAS_MaxPadType            (32)            // TBD
  50. #define    RAS_MaxX25Address        (200)            // TBD
  51. #define    RAS_MaxFacilities        (200)            // TBD
  52. #define    RAS_MaxUserData            (200)            // TBD
  53.  
  54. // RAS IP Address
  55.  
  56. typedef    struct    tagRasIpAddr
  57. {
  58.     BYTE    a;
  59.     BYTE    b;
  60.     BYTE    c;
  61.     BYTE    d;
  62. }
  63. RASIPADDR;
  64.  
  65. // RAS Entry Definition
  66.  
  67. typedef    struct    tagRasEntry    
  68. {
  69.     DWORD        dwSize;
  70.     DWORD        dwfOptions;
  71.     DWORD        dwCountryID;
  72.     DWORD        dwCountryCode;
  73.     TCHAR        szAreaCode[ RAS_MaxAreaCode + 1 ];
  74.     TCHAR        szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  75.     DWORD        dwAlternatesOffset;
  76.     RASIPADDR    ipaddr;
  77.     RASIPADDR    ipaddrDns;
  78.     RASIPADDR    ipaddrDnsAlt;
  79.     RASIPADDR    ipaddrWins;
  80.     RASIPADDR    ipaddrWinsAlt;
  81.     DWORD        dwFrameSize;
  82.     DWORD        dwfNetProtocols;
  83.     DWORD        dwFramingProtocol;
  84.     TCHAR        szScript[ MAX_PATH ];
  85.     TCHAR        szAutoDialDll[ MAX_PATH ];
  86.     TCHAR        szAutoDialFunc[ MAX_PATH ];
  87.     TCHAR        szDeviceType[ RAS_MaxDeviceType + 1 ];
  88.     TCHAR        szDeviceName[ RAS_MaxDeviceName + 1 ];
  89.     TCHAR        szX25PadType[ RAS_MaxPadType + 1 ];
  90.     TCHAR        szX25Address[ RAS_MaxX25Address + 1 ];
  91.     TCHAR        szX25Facilities[ RAS_MaxFacilities + 1 ];
  92.     TCHAR        szX25UserData[ RAS_MaxUserData + 1 ];
  93.     DWORD        dwChannels;
  94.     DWORD        dwReserved1;
  95.     DWORD        dwReserved2;
  96. }
  97. RASENTRY, *LPRASENTRY;
  98.  
  99.  
  100. /* Describes Country Information
  101. */
  102. typedef struct  tagRasCtryInfo {
  103.     DWORD       dwSize;
  104.     DWORD       dwCountryID;
  105.     DWORD       dwNextCountryID;
  106.     DWORD       dwCountryCode;
  107.     DWORD       dwCountryNameOffset;
  108. } RASCTRYINFO;
  109. typedef RASCTRYINFO * LPRASCTRYINFO;
  110.  
  111. /* Describes RAS Device Information
  112. */
  113. typedef struct  tagRasDevInfo {
  114.     DWORD       dwSize;
  115.     CHAR        szDeviceType[RAS_MaxDeviceType+1];
  116.     CHAR        szDeviceName[RAS_MaxDeviceName+1];
  117. } RASDEVINFO;
  118. typedef RASDEVINFO * LPRASDEVINFO;
  119.  
  120. /* RASENTRY 'dwfOptions' bit flags.
  121. */
  122. #define RASEO_UseCountryAndAreaCodes  0x00000001
  123. #define RASEO_SpecificIpAddr          0x00000002
  124. #define RASEO_SpecificNameServers     0x00000004
  125. #define RASEO_IpHeaderCompression     0x00000008
  126. #define RASEO_RemoteDefaultGateway    0x00000010
  127. #define RASEO_DisableLcpExtensions    0x00000020
  128. #define RASEO_TerminalBeforeDial      0x00000040
  129. #define RASEO_TerminalAfterDial       0x00000080
  130. #define RASEO_ModemLights             0x00000100
  131. #define RASEO_SwCompression           0x00000200
  132. #define RASEO_RequireEncryptedPw      0x00000400
  133. #define RASEO_RequireMsEncryptedPw    0x00000800
  134. #define RASEO_RequireDataEncryption   0x00001000
  135. #define RASEO_NetworkLogon            0x00002000
  136. #define RASEO_UseLogonCredentials     0x00004000
  137. #define RASEO_PromoteAlternates       0x00008000
  138. #define RASEO_SecureLocalFiles        0x00010000
  139. #define RASEO_DialAsLocalCall         0x00020000
  140.  
  141.  
  142. /* RASENTRY 'dwfNetProtocols' bit flags. (session negotiated protocols)
  143. */
  144. #define RASNP_Netbeui       0x00000001  // Negotiate NetBEUI
  145. #define RASNP_Ipx           0x00000002  // Negotiate IPX
  146. #define RASNP_Ip            0x00000004  // Negotiate TCP/IP
  147.  
  148.  
  149. /* RASENTRY 'dwFramingProtocols' (framing protocols used by the server)
  150. */
  151. #define RASFP_Ppp           0x00000001  // Point-to-Point Protocol (PPP)
  152. #define RASFP_Slip          0x00000002  // Serial Line Internet Protocol (SLIP)
  153. #define RASFP_Ras           0x00000004  // Microsoft proprietary protocol
  154.  
  155.  
  156. /* RASENTRY 'szDeviceType' strings
  157. */
  158. #define RASDT_Direct        TEXT("direct")    // Direct Connect (WINCE Extension)
  159. #define RASDT_Modem         TEXT("modem")     // Modem
  160. #define RASDT_Isdn          TEXT("isdn")      // ISDN
  161. #define RASDT_X25           TEXT("x25")       // X.25
  162.  
  163.  
  164.  
  165. DECLARE_HANDLE( HRASCONN );
  166. typedef HRASCONN *LPHRASCONN;
  167.  
  168. // Identifies an active RAS connection.  (See RasEnumConnections)
  169.  
  170. typedef struct tagRASCONN
  171. {
  172.     DWORD    dwSize;
  173.     HRASCONN hrasconn;
  174.     TCHAR    szEntryName[ RAS_MaxEntryName + 1 ];
  175. RASCONN, *LPRASCONN;
  176.  
  177. // Enumerates intermediate states to a connection.  (See RasDial)
  178.  
  179. #define RASCS_PAUSED 0x1000
  180. #define RASCS_DONE   0x2000
  181.  
  182. typedef enum tagRASCONNSTATE
  183. {
  184.     RASCS_OpenPort = 0,
  185.     RASCS_PortOpened,
  186.     RASCS_ConnectDevice,
  187.     RASCS_DeviceConnected,
  188.     RASCS_AllDevicesConnected,
  189.     RASCS_Authenticate,
  190.     RASCS_AuthNotify,
  191.     RASCS_AuthRetry,
  192.     RASCS_AuthCallback,
  193.     RASCS_AuthChangePassword,
  194.     RASCS_AuthProject,
  195.     RASCS_AuthLinkSpeed,
  196.     RASCS_AuthAck,
  197.     RASCS_ReAuthenticate,
  198.     RASCS_Authenticated,
  199.     RASCS_PrepareForCallback,
  200.     RASCS_WaitForModemReset,
  201.     RASCS_WaitForCallback,
  202.     RASCS_Projected,
  203.  
  204.     RASCS_Interactive             = RASCS_PAUSED,
  205.     RASCS_RetryAuthentication,
  206.     RASCS_CallbackSetByCaller,
  207.     RASCS_PasswordExpired,
  208.  
  209.     RASCS_Connected             = RASCS_DONE,
  210.     RASCS_Disconnected
  211. RASCONNSTATE, *LPRASCONNSTATE;
  212.  
  213.  
  214. // Describes the status of a RAS connection.  (See RasConnectionStatus)
  215.  
  216. typedef struct tagRASCONNSTATUS
  217. {
  218.     DWORD        dwSize;
  219.     RASCONNSTATE rasconnstate;
  220.     DWORD        dwError;
  221.     TCHAR        szDeviceType[ RAS_MaxDeviceType + 1 ];
  222.     TCHAR        szDeviceName[ RAS_MaxDeviceName + 1 ];
  223. }
  224. RASCONNSTATUS, *LPRASCONNSTATUS;
  225.  
  226.  
  227. // Describes connection establishment parameters.  (See RasDial)
  228.  
  229. typedef struct tagRASDIALPARAMS
  230. {
  231.     DWORD dwSize;
  232.     TCHAR szEntryName[ RAS_MaxEntryName + 1 ];
  233.     TCHAR szPhoneNumber[ RAS_MaxPhoneNumber + 1 ];
  234.     TCHAR szCallbackNumber[ RAS_MaxCallbackNumber + 1 ];
  235.     TCHAR szUserName[ UNLEN + 1 ];
  236.     TCHAR szPassword[ PWLEN + 1 ];
  237.     TCHAR szDomain[ DNLEN + 1 ];
  238. }
  239. RASDIALPARAMS, *LPRASDIALPARAMS;
  240.  
  241.  
  242. // Describes extended connection establishment options.  (See RasDial)
  243.  
  244. typedef struct tagRASDIALEXTENSIONS
  245. {
  246.     DWORD dwSize;
  247.     DWORD dwfOptions;
  248.     HWND  hwndParent;
  249.     DWORD reserved;
  250. RASDIALEXTENSIONS, *LPRASDIALEXTENSIONS;
  251.  
  252. // 'dwfOptions' bit flags.
  253.  
  254. #define RDEOPT_UsePrefixSuffix           0x00000001
  255. #define RDEOPT_PausedStates              0x00000002
  256. #define RDEOPT_IgnoreModemSpeaker        0x00000004
  257. #define RDEOPT_SetModemSpeaker           0x00000008
  258. #define RDEOPT_IgnoreSoftwareCompression 0x00000010
  259. #define RDEOPT_SetSoftwareCompression    0x00000020
  260.  
  261.  
  262. // Describes an enumerated RAS phone book entry name.  (See RasEntryEnum)
  263.  
  264. typedef struct tagRASENTRYNAME
  265. {
  266.     DWORD dwSize;
  267.     TCHAR szEntryName[ RAS_MaxEntryName + 1 ];
  268. RASENTRYNAME, *LPRASENTRYNAME;
  269.  
  270.  
  271. // Protocol code to projection data structure mapping.
  272.  
  273. typedef enum tagRASPROJECTION
  274. {
  275.     RASP_Amb = 0x10000,
  276.     RASP_PppNbf = 0x803F,
  277.     RASP_PppIpx = 0x802B,
  278.     RASP_PppIp = 0x8021
  279. }
  280. RASPROJECTION, *LPRASPROJECTION;
  281.  
  282. /* 
  283. ** Describes the result of a RAS AMB (Authentication Message Block)
  284. ** projection.  This protocol is used with NT 3.1 and OS/2 1.3 downlevel
  285. ** RAS servers.
  286. */
  287.  
  288. typedef struct tagRASAMBA
  289. {
  290.     DWORD dwSize;
  291.     DWORD dwError;
  292.     TCHAR  szNetBiosError[ NETBIOS_NAME_LEN + 1 ];
  293.     BYTE  bLana;
  294. RASAMB, *LPRASAMB;
  295.  
  296. // Describes the result of a PPP NBF (NetBEUI) projection.
  297.  
  298. typedef struct tagRASPPPNBFW
  299. {
  300.     DWORD dwSize;
  301.     DWORD dwError;
  302.     DWORD dwNetBiosError;
  303.     TCHAR szNetBiosError[ NETBIOS_NAME_LEN + 1 ];
  304.     TCHAR szWorkstationName[ NETBIOS_NAME_LEN + 1 ];
  305.     BYTE  bLana;
  306. RASPPPNBF, *LPRASPPPNBF;
  307.  
  308.  
  309. // Describes the results of a PPP IPX (Internetwork Packet Exchange)
  310. // projection.
  311.  
  312. typedef struct tagRASIPX
  313. {
  314.     DWORD dwSize;
  315.     DWORD dwError;
  316.     TCHAR szIpxAddress[ RAS_MaxIpxAddress + 1 ];
  317. RASPPPIPX, *LPRASPPPIPX;
  318.  
  319. // Describes the results of an PPP IP (Internet) projection.
  320.  
  321. typedef struct tagRASPPPIP
  322. {
  323.     DWORD dwSize;
  324.     DWORD dwError;
  325.     TCHAR szIpAddress[ RAS_MaxIpAddress + 1 ];
  326. RASPPPIP, *LPRASPPPIP;
  327.  
  328. // Describes results of a GET_WINS/DNS I/O control. If
  329. // the requested address has been negotiated the boolean
  330. // valid is TRUE and the IpAddress contains the address of
  331. // the requested server.  If Valid is false IpAddress is
  332. // zero.
  333.  
  334. typedef    struct    tagRASPPPAddr
  335. {
  336.     DWORD    dwSize;
  337.     DWORD    dwError;
  338.     BOOL    Valid;
  339.     DWORD    IpAddress;
  340. }
  341. RASPPPADDR;
  342.  
  343. //     RAS Control Structures
  344. //
  345. //     Control Request Enumeration
  346.  
  347. typedef    enum    tagRasCntlEnum
  348. {
  349.     RASCNTL_NULL,                                // NULL request
  350.     RASCNTL_SESSION_DELETE,                        // delete a session
  351.     RASCNTL_CONNECTION_HANGUP,                    // hangup connection
  352.     RASCNTL_USER_CREDENTIALS,                    // set user credentials
  353.     RASCNTL_SET_DEBUG,                            // set debug control params
  354.     RASCNTL_LOCK_STATUS,                        // get session's lock status
  355.     RASCNTL_PRINT_CS,                            // print cs info
  356.     RASCNTL_STATISTICS,                            // Get statistics
  357.  
  358.     // Add others here
  359. }
  360. RasCntlEnum_t;
  361.  
  362. // 
  363. // RasDial message notifications are sent with Message ID set to
  364. // WM_RASDIALEVENT
  365. //
  366.  
  367. #define RASDIALEVENT        "RasDialEvent"
  368.  
  369. #define WM_RASDIALEVENT     0xCCCD
  370.  
  371.  
  372. #ifdef UNDER_CE
  373.  
  374. // This structure is used by the RnaApp application on WINCE
  375. // to signal when a connection has occured.
  376.  
  377. typedef struct tagRNAAppInfo {
  378.     DWORD    dwSize;                    // The size of this structure
  379.     DWORD    hWndRNAApp;                // The handle of the RNAApp window
  380.     DWORD    Context;                // Context value specified on CmdLine
  381.     DWORD    ErrorCode;                // Last error code
  382.     TCHAR    RasEntryName[RAS_MaxEntryName+1];
  383. } RNAAPP_INFO, *PRNAAPP_INFO;
  384.  
  385.  
  386. #define RNA_RASCMD        WM_USER+1
  387. #define    RNA_ADDREF        1
  388. #define RNA_DELREF        2
  389. #endif
  390.  
  391. #include "poppack.h"
  392.  
  393. #ifndef RASAPI
  394. #ifdef _WIN32_WCE_EMULATION
  395. #define RASAPI    WINAPI
  396. #else
  397. #define RASAPI
  398. #endif
  399. #endif
  400.  
  401. DWORD RASAPI RasDial (LPRASDIALEXTENSIONS dialExtensions,
  402.            LPTSTR phoneBookPath,
  403.            LPRASDIALPARAMS rasDialParam,
  404.            DWORD NotifierType,
  405.            LPVOID notifier,
  406.            LPHRASCONN pRasConn);
  407. DWORD RASAPI RasHangup (HRASCONN Session);    // Kept for historical compatibility
  408. DWORD RASAPI RasHangUp (HRASCONN Session);
  409. DWORD RASAPI RasEnumEntries (LPWSTR Reserved,
  410.               LPWSTR lpszPhoneBookPath,
  411.               LPRASENTRYNAME lprasentryname,
  412.               LPDWORD lpcb,
  413.               LPDWORD lpcEntries);
  414. DWORD RASAPI RasGetEntryDialParams (LPWSTR lpszPhoneBook,
  415.                  LPRASDIALPARAMS lpRasDialParams,    
  416.                  LPBOOL lpfPassword);
  417. DWORD RASAPI RasSetEntryDialParams (LPWSTR lpszPhoneBook,
  418.                  LPRASDIALPARAMS lpRasDialParams,
  419.                  BOOL fRemovePassword);
  420. DWORD RASAPI RasGetEntryProperties (LPWSTR lpszPhoneBook,
  421.                  LPWSTR szEntry,
  422.                  LPBYTE lpbEntry,
  423.                  LPDWORD lpdwEntrySize,
  424.                  LPBYTE lpb,
  425.                  LPDWORD lpdwSize);
  426. DWORD RASAPI RasSetEntryProperties (LPWSTR lpszPhoneBook,        
  427.                  LPWSTR szEntry,
  428.                  LPBYTE lpbEntry,
  429.                  DWORD dwEntrySize,
  430.                  LPBYTE lpb,
  431.                  DWORD dwSize);
  432. DWORD RASAPI RasValidateEntryName (LPWSTR lpszPhonebook,        
  433.                 LPWSTR lpszEntry);
  434. DWORD RASAPI RasDeleteEntry (LPWSTR lpszPhonebook,
  435.               LPWSTR lpszEntry);
  436. DWORD RASAPI RasRenameEntry (LPWSTR lpszPhonebook,
  437.               LPWSTR lpszOldEntry,
  438.               LPWSTR lpszNewEntry);
  439. DWORD RASAPI RasEnumConnections (LPRASCONN lprasconn,
  440.               LPDWORD lpcb,
  441.               LPDWORD lpcConnections);
  442. DWORD RASAPI RasGetConnectStatus (HRASCONN rasconn,                
  443.                LPRASCONNSTATUS lprasconnstatus);
  444. DWORD RASAPI RasGetEntryDevConfig (LPCTSTR szPhonebook,
  445.                 LPCTSTR szEntry,
  446.                 LPDWORD pdwDeviceID,
  447.                 LPDWORD pdwSize,
  448.                 LPVARSTRING pDeviceConfig);
  449. DWORD RASAPI RasSetEntryDevConfig (LPCTSTR szPhonebook,
  450.                 LPCTSTR szEntry,
  451.                 DWORD dwDeviceID,
  452.                 LPVARSTRING lpDeviceConfig);
  453.  
  454. #ifdef __cplusplus
  455. }
  456. #endif
  457.  
  458.  
  459. #ifdef WINCEOEM
  460. #include <pras.h>    // internal defines 
  461. #endif
  462.  
  463. #endif // _RAS_H_
  464.  
  465. // @CESYSGEN ENDIF
  466.